package chapter_07_adapter.myObjectAdapter;

/**
 * Created by CharloYao on 2017/3/14.
 * 对象适配器，组合了被适配对象
 */
public class    Adapter implements INewFunction {

    private OldFunction oldFunction;            //被适配的类

    public Adapter(OldFunction oldFunction) {
        this.oldFunction = oldFunction;
    }

    @Override
    public void newFunction() {
        this.oldFunction.oldFunction();
    }
}
